#ifndef __MYSQLCLIENT_HPP__
#define __MYSQLCLIENT_HPP__
#include <mysql/field_types.h>
#include <mysql/mysql.h>

#include <string>
#include <vector>
using std::string;
using std::vector;

namespace wd{

class MySQLClient{
public:
    MySQLClient();
    ~MySQLClient();

    bool connect(const string & host,
                 unsigned short port,
                 const string & user,
                 const string & passwd,
                 const string & db
                 );

    bool writeQuery(const string & sql);
    vector<vector<string>> readQuery(const string & sql);
    
    static void show_res(const vector<vector<string>> & res);
private:

    MYSQL _conn;

};


}



#endif // __MYSQLCLIENT_HPP__

